package com.mpsc.sharding.service.impl;

import com.codingapi.txlcn.tc.annotation.DTXPropagation;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.mpsc.api.bean.RoleInfoEntity;
import com.mpsc.sharding.dao.RoleInfoDao;
import com.mpsc.sharding.service.RoleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

//@Transactional
@Service("roleInfoService")
public class RoleInfoServiceImpl implements RoleInfoService {

    @Autowired
    private RoleInfoDao roleInfoDao;

    @Override
    @LcnTransaction(propagation = DTXPropagation.REQUIRED)
    public void saveRoleInfo(RoleInfoEntity roleInfo) {
        roleInfoDao.saveRoleInfo(roleInfo);
        throw new RuntimeException("手动抛出一个异常！！！");
    }
}
